#导入copy模块
import  copy
#浅拷贝  拷贝外成
# list1=[1,2,3,['A','B','C']]
# list2=copy.copy(list1)
# print(list1)
# print(list2)
# print('flist1:{id(list1)}')
# print('flist2:{id(list2)}')
# list2[3][0]='AAA'
# print(list1)
#
# str ='短发卷发就卷发'
# str2=copy.copy(str)
# print(print(f'str:{id(str)}'))
# print(print(f'str2:{id(str2)}'))

#深拷贝
aaa =[1,2,2,[4,5,['a','b']]]
aaa2=copy.deepcopy(aaa)
print(print(f'aaa:{id(aaa)}'))
print(print(f'aaa2:{id(aaa2)}'))

print(f'aaa[2]:{id(aaa[2])}')
print(f'aaa2[2]:{id(aaa2[2])}')
print(f'aaa[1][1]:{id(aaa[1][1])}')
print(f'aaa2[2][2]:{id(aaa2[2][2])}')

aaa[3][1] = 'bbb'
print(aaa)


